# Maintainer: Bruno Pagani <archange@archlinux.org>

pkgname=restinio
pkgver=0.6.17
pkgrel=1
pkgdesc="Header-only C++14 library that gives you an embedded HTTP/Websocket server"
arch=(any)
url="https://stiffstream.com/en/products/restinio.html"
license=(BSD)
depends=(asio http-parser fmt)
makedepends=(cmake gcc openssl zlib pcre pcre2 boost)
source=(https://github.com/Stiffstream/restinio/releases/download/v.${pkgver}/${pkgname}-${pkgver}.tar.bz2)
sha256sums=('cea0c46906196e97c30b2bfefbfd49578c9f870a89501d7ce5cd39bbd376142a')

build() {
  cmake -B build -S ${pkgname}-${pkgver}/dev/ \
      -DCMAKE_BUILD_TYPE=Release \
      -DCMAKE_INSTALL_PREFIX=/usr \
      -DRESTINIO_FIND_DEPS=ON \
      -DRESTINIO_TEST=OFF \
      -DRESTINIO_SAMPLE=OFF \
      -DRESTINIO_INSTALL_SAMPLES=OFF \
      -DRESTINIO_BENCH=OFF \
      -DRESTINIO_INSTALL_BENCHES=OFF \
      -DRESTINIO_ALLOW_SOBJECTIZER=OFF \
      -DRESTINIO_USE_EXTERNAL_HTTP_PARSER=ON
  make -C build
}

package() {
  make -C build DESTDIR="${pkgdir}" install
  install -Dm644 ${pkgname}-${pkgver}/LICENSE -t "${pkgdir}"/usr/share/licenses/${pkgname}
}
